<template lang="jade">




li(v-if=" productype=='group' ", v-link="{ name: 'group', params: { groupId: item.name_no } }")
	div.title 
		span.name {{item.name}}
		span.fr 起投金额:50万元
	flexbox
		flexbox-item(style="-ms-flex: 1.7;flex: 1.7;-webkit-box-flex: 1.7;")
			span 借款金额
			b {{item.account}}元
		flexbox-item
			span 约定收益率
			b.mtxt {{item.borrow_apr}}%
		flexbox-item
			span 借款期限
			b {{item.borrow_period}}个月
		flexbox-item
			a.p_btn_nob.tcenter {{item.status_str}}

	flexbox
		flexbox-item(:span="6",  style=" min-width:110px;")
			剩余可投金额:{{item.pick}}元
		flexbox-item
			progress(:percent="item.percentage", :show-cancel="false")
		flexbox-item(:span="2") 
			span.mtxt {{item.percentage}}%


li(v-if=" productype=='current' && item.count_number > 1  ",  @click ="goList(item.name_no)" , v-bind:class="{ 'full': item.status == '4'}"    )
	div.title
		span.name{{item.name}}
		span.fr 起投金额:100元
	flexbox
		flexbox-item(style="-ms-flex: 1.7;flex: 1.7;-webkit-box-flex: 1.7;")
			span 借款金额
			b {{item.account}}元
		flexbox-item
			span 约定收益率
			b.mtxt {{item.borrow_apr}}%
		flexbox-item
			span 借款期限
			b {{item.borrow_period}}个月
		flexbox-item
			a.p_btn_nob.tcenter {{item.status_str}}

	flexbox
		flexbox-item(:span="6",  style=" min-width:110px;")
			剩余可投金额:{{item.borrow_account_wait}}元
		flexbox-item
			progress(:percent="item.borrow_account_scale", :show-cancel="false")
		flexbox-item(:span="2") 
			span.mtxt {{item.borrow_account_scale}}%


li(v-if=" productype=='current' && item.count_number <= 1 ", v-link="{ name: 'detail', params: { detailId:  item.borrow_nid } }", v-bind:class="{ 'full': item.status == '4'}" )
	div.title
		span.name{{item.name}}
		span.fr 起投金额:100元
	flexbox
		flexbox-item(style="-ms-flex: 1.7;flex: 1.7;-webkit-box-flex: 1.7;")
			span 借款金额
			b {{item.account}}元
		flexbox-item
			span 约定收益率
			b.mtxt {{item.borrow_apr}}%
		flexbox-item
			span 借款期限
			b {{item.borrow_period}}个月
		flexbox-item
			a.p_btn_nob.tcenter {{item.status_str}}

	flexbox
		flexbox-item(:span="6",  style=" min-width:110px;")
			剩余可投金额:{{item.borrow_account_wait}}元
		flexbox-item
			progress(:percent="item.borrow_account_scale", :show-cancel="false")
		flexbox-item(:span="2") 
			span.mtxt {{item.borrow_account_scale}}%

</template>

<style>
@import '~vux/dist/vux.css';
</style>

<script>
//import '../../assets/sass/common/circle.scss'
//import CssCircle from '../../v-circle/components/css-circle.vue'
import {Progress, Swiper, Flexbox, FlexboxItem} from 'vux'

export default{
	props:['item', 'items', 'productype', 'name_no_status'],
	components: {
	    Progress,
	    Swiper,
	    Flexbox,
	    FlexboxItem
	},

	methods:{
		getlink(a, b){
			var link = "";
			if ( a == undefined )
				link = '/detail/'+b;
			else
				link = '/item/'+a;
			return link;
		},
	    goList(id){
	    	//console.log(id);
 
			this.items = [];
			//this.fetch(1);
			//this.$emit('fetch', 1);
			this.$dispatch('get', id);
			//this.$route.router.go('/invest/'+id)
			document.body.scrollTop =0

	    }
	}
}
</script>



<style lang="scss" scoped>

.vux-flex-row{
	display: flex;
	display: -webkit-flex;
	-webkit-align-items:center;

}

.vux-flexbox-item{
	display: block;
	width:100%;
}
</style>
